public class Solution1175 {
    public int numPrimeArrangements(int n) {
        int count=0;
        for (int i=2;i<=n;i++){
            if (isPrime(i)){
                count++;
            }
        }
        long ans=1;
        int mod=1000000007;
        for (int i=2;i<=count;i++){
            ans=(ans*i)%mod;
        }
        for (int i=2;i<=n-count;i++){
            ans=(ans*i)%mod;
        }
        return (int)ans;
    }

    private boolean isPrime(int k) {
        for (int i=2;i*i<=k;i++){
            if (k%i==0){
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1175().numPrimeArrangements(100));
    }
}
